const mongoose = require('mongoose');
const Cats = require('./model/cat');

mongoose.connect('mongodb://localhost:27017/cats',{useNewUrlParser:true,useUnifiedTopology:true})
.then(()=>{
    console.log("open")
})
.catch(err =>{
    console.log("error");
    console.log(err)
})

const kat = new Cats({
    name:'kat',
    type:'大橘',
    labels:'silly cute'
})

kat.save().then(kat => {
    console.log(kat);
})
    .catch(e=>{
        console.log(e);
    })
